<template>
	<view>
        <!-- <view v-for="item,index in array">
            {{index}} : {{item}}
        </view> -->
		
<!-- 		<view v-for="item,index in array">
		            序号：{{index}}  ，姓名：{{item.name}} 分数：{{item.score}}
		</view> -->
		
		<!-- <view v-for="(value, name, index) in object">
		        	{{ index }}. {{ name }} : {{ value }}
		        	</view>
		</view> -->
		
<!-- 		<view v-for="(value, name, index) in object">
		    <text style="font-size: 20px;">序号：{{index}},</text>
		    <text style="font-size: 20px;">属性名：{{name}},</text>
		    <text style="font-size: 20px;">属性值：{{index}}</text>
		</view> -->
		
		<view v-for="(item, index) in array" :key="item.id">
		            {{item.name}} 分数：{{item.score}}
		            <checkbox></checkbox>
		</view>
		<button @click="onclicked">删除第二个元素</button>
		
    </view>
</template>

<script>
	export default {
		data() {
			return {
				//array: [ 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 ],
				array: [ {
				                    id: 0,
				                    name: "小强",
				                    score: 98.5
				                }, {
				                    id: 1,
				                    name: "小李",
				                    score: 96
				                }, {
				                    id: 2,
				                    name: "小张",
				                    score: 97.5
				                } ],
				object: {
					title: '第四课：列表渲染 v-for',
					type: '视频教程',
				}
			}
		},
		onLoad() {

		},
		methods: {
            onclicked() {
                this.array.splice( 1, 1 );//删除数组中的 第 2 个元素。
            }
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
